<%--
  Created by IntelliJ IDEA.
  User: 群威
  Date: 2017/9/21
  Time: 21:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="common/tag.jsp"%>
<html>
<head>
    <title>部门列表</title>
    <%@ include file="common/head.jsp"%>
</head>
<body>
<div class="table-responsive">
    <div>
        <caption>部门列表</caption>
        <div style="display: inline;float: right;">
            <button onclick="javascript:ManagerSystem.addPage.addDepartment()" type="button" class="btn btn-info">添加部门</button>
        </div>
    </div>
    <table class="table">
        <thead>
        <tr>
            <th>序号</th>
            <th>部门名称</th>
            <th>部门介绍</th>
            <th>查看人员</th>
            <th>修改部门</th>
            <th>删除部门</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${pageBean.list}" var="list" varStatus="vs">
        <tr>
            <td>${vs.count+pageBean.pageSize*(pageBean.currentPage-1)}</td>
            <td>${list.dname}</td>
            <td>${list.ddesc}</td>
            <td><a href="javascript:void(0)" onclick="javascript:ManagerSystem.detailPage.employeeList({rid:${pageBean.rid},did:${list.did},dname:'${list.dname}',currentPage:1})"><img width="20" height="20" src="${pageContext.request.contextPath}/images/commons/employees.png"></a></td>
            <td><a href="javascript:void(0)" onclick="javascript:ManagerSystem.editPage.editDepartment({did:${list.did},currentPage:${pageBean.currentPage}})"><img src="${pageContext.request.contextPath}/images/commons/edit.png"></a></td>
            <td><a href="javascript:void(0)" onclick="javascript:ManagerSystem.deletePage.deleteDepartment({did:${list.did},currentPage:${pageBean.currentPage}})"><img width="20" height="20" src="${pageContext.request.contextPath}/images/commons/delete.png"></a></td>
        </tr>
        </c:forEach>
        </tbody>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
        <tr>
            <td align="center">
                <span>
                    <c:if test="${pageBean.currentPage != 1}">
                    <a href="javascript:ManagerSystem.detailPage.allDepartmentDetail(1)">[首页]</a>
                    <a href="javascript:ManagerSystem.detailPage.allDepartmentDetail(${pageBean.currentPage}-1)">[上一页]</a>
                    </c:if>
                    <c:if test="${pageBean.currentPage != pageBean.totalPage}">
                    <a href="javascript:ManagerSystem.detailPage.allDepartmentDetail(${pageBean.currentPage}+1)">[下一页]</a>
                    <a href="javascript:ManagerSystem.detailPage.allDepartmentDetail(${pageBean.totalPage})">[尾页]</a>
                    </c:if>
                </span>
            </td>
        </tr>
        <tr>
            <td align="center">
                <span>
                    第 ${pageBean.currentPage} / ${pageBean.totalPage} 页
                </span>
                <span>
                    共 ${pageBean.totalCount} 条记录
                </span>
            </td>
        </tr>
    </table>
</div>
</body>
<%@ include file="common/bootstrap.jsp"%>
<script src="<%=request.getContextPath()%>/resources/scripts/ManagerSystem.js" type="text/javascript"></script>
</html>
